package callstackintrospection2;

//start extract LoggerImpl
public class LoggerImpl implements Logger {

//stop extract LoggerImpl
	public static String cn;
	public static String mn;
	public static int ln;
//start extract LoggerImpl
    public void logRecord( String message, int logRecordType ) {
	Throwable ex = new Throwable();
	StackTraceElement ste = ex.getStackTrace()[1];
	
	String callerClassName = ste.getClassName();
	String callerMethodName = ste.getMethodName();
	int callerLineNum = ste.getLineNumber();
	
	// write of log record goes here
//stop extract LoggerImpl
	System.out.println( "callerClassName  = " + callerClassName );
	System.out.println( "callerMethodName  = " + callerMethodName );
	System.out.println( "callerLineNum  = " + callerLineNum );
	cn = callerClassName;
	mn = callerMethodName;
	ln = callerLineNum;
//start extract LoggerImpl
    }
    
    public void logProblem( Throwable t ) {
	// write of log record goes here
    }
}
//stop extract LoggerImpl
